package academic.ui.client.widgets.forms;

import java.util.ArrayList;

import ecommerce.soco.shared.*;
import ui.client.GenericContainerTag;
import ui.client.widgets.PickListBox;

public class PickCityForm extends FormWidget{

	
	private PickListBox plb = new PickListBox();
	
	public PickCityForm() {
		div.clear();
		div.add(new GenericContainerTag("span","choose city"));
		div.add(plb);
		div.setStyleName("pickCityForm");
		//styles
		plb.setStyleName("cityPickList");
	}
	
	public void setListBoxValues(ArrayList<GWT_City> cities) {
		for(GWT_City city : cities)
		{
			plb.addItem(city.getCityName(), String.valueOf(city.getId()));
		}
	}
	
	public String getSelectedValue() {
		return plb.getValue(plb.getSelectedIndex());
	}
	
	public PickListBox getPickListBox() {
		return plb;
	}
}
